<template>
  <footer>
    <router-link active-class="active" to="/home">
      <div class="item">
        <van-icon size="20" name="wap-home-o" />
        <span>首页</span>
      </div>
    </router-link>
    <router-link active-class="active" to="/type">
      <div class="item">
        <van-icon size="20" name="apps-o" />
        <span>分类</span>
      </div>
    </router-link>
    <router-link active-class="active" to="/cart">
      <div class="item">
        <van-icon size="20" name="shopping-cart-o" />
        <span>购物车</span>
      </div>
    </router-link>
    <router-link active-class="active" to="/my">
      <div class="item">
        <van-icon size="20" name="contact-o" />
        <span>我的</span>
      </div>
    </router-link>
    
  </footer>
</template>



<style lang="less" scoped>
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #fff;
  height: 50px;
  /* 设置对齐 */
  display: flex;
  justify-content: space-around;
  align-items: center;
}

footer .item {
  height: 100%;
  display: flex;
  flex-direction: column;
  /* 竖直排列 */
  align-items: center;
  justify-content: center;
}

footer span {
  font-size: 14px;
  margin-top: 3px;
}

footer .iconfont {
  font-size: 16px;
}

.active {
  color: #f00;
}
</style>